<template>
  <div class="hot-recommendations">
    <div class="section-header">
      <div class="title-section">
        <div class="title-icon">🔴</div>
        <h3 class="section-title">热门推荐</h3>
      </div>
      <a href="#" class="more-link">更多 ›</a>
    </div>
    
    <!-- 分类标签 -->
    <div class="category-tabs">
      <button class="tab active">华语</button>
      <button class="tab">流行</button>
      <button class="tab">摇滚</button>
      <button class="tab">民谣</button>
      <button class="tab">电子</button>
    </div>
    
    <!-- 音乐项目网格 -->
    <div class="music-grid">
      <div class="music-item" v-for="item in musicItems" :key="item.id">
        <div class="item-image">
          <img :src="item.image" :alt="item.title" class="cover-image">
          <div class="play-overlay">
            <button class="play-btn">▶️</button>
          </div>
        </div>
        <div class="item-info">
          <div class="listens">
            <span class="headphone-icon">🎧</span>
            <span class="listens-count">{{ item.listens }}</span>
          </div>
          <h4 class="item-title">{{ item.title }}</h4>
          <p class="item-desc">{{ item.description }}</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HotRecommendations',
  data() {
    return {
      musicItems: [
        {
          id: 1,
          image: 'https://via.placeholder.com/200x200/333/fff?text=陈奕迅',
          title: '最陈奕迅·精选',
          description: 'Eason Chan\'s Best Selection',
          listens: '4423万'
        },
        {
          id: 2,
          image: 'https://via.placeholder.com/200x200/ff6b6b/fff?text=合唱',
          title: '麻麻,我想跟他们合唱!',
          description: '我想和你唱特辑',
          listens: '4312万'
        },
        {
          id: 3,
          image: 'https://via.placeholder.com/200x200/4ecdc4/fff?text=说唱',
          title: '伤感说唱',
          description: '不要再为他鼻酸了',
          listens: '5422万'
        },
        {
          id: 4,
          image: 'https://via.placeholder.com/200x200/45b7d1/fff?text=韩国',
          title: '电台节目',
          description: '005.人在韩国刚落地,夜店医美怎么去?韩国旅游初体验',
          listens: '2426万'
        },
        {
          id: 5,
          image: 'https://via.placeholder.com/200x200/96ceb4/fff?text=动漫',
          title: '我爱你 第一句是假的 第二句也是假的',
          description: '动漫音乐精选',
          listens: '2715万'
        },
        {
          id: 6,
          image: 'https://via.placeholder.com/200x200/ffeaa7/333?text=盖茨',
          title: '电台节目',
          description: '《源代码》:比尔·盖茨自传——————如何从叛逆少年到科技巨...',
          listens: '2031万'
        },
        {
          id: 7,
          image: 'https://via.placeholder.com/200x200/dda0dd/fff?text=戏腔',
          title: '一曲戏腔极尽风流, 一抹笑靥极尽欢颜。',
          description: '传统戏曲音乐',
          listens: '2986万'
        },
        {
          id: 8,
          image: 'https://via.placeholder.com/200x200/fdcb6e/333?text=DJ',
          title: '电台节目',
          description: '麒麟+兰亭序DJ',
          listens: '48万'
        }
      ]
    }
  }
}
</script>

<style scoped>
.hot-recommendations {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.title-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.title-icon {
  font-size: 20px;
}

.section-title {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
  color: #333;
}

.more-link {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.more-link:hover {
  color: #c20c0c;
}

.category-tabs {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

.tab {
  background: none;
  border: none;
  padding: 8px 16px;
  font-size: 14px;
  color: #666;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.3s;
}

.tab:hover {
  color: #c20c0c;
  background: rgba(194, 12, 12, 0.1);
}

.tab.active {
  color: #c20c0c;
  background: rgba(194, 12, 12, 0.1);
  font-weight: bold;
}

.music-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.music-item {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.music-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.item-image {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.music-item:hover .cover-image {
  transform: scale(1.05);
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.music-item:hover .play-overlay {
  opacity: 1;
}

.play-btn {
  background: rgba(194, 12, 12, 0.9);
  border: none;
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s;
}

.play-btn:hover {
  background: #c20c0c;
  transform: scale(1.1);
}

.item-info {
  padding: 15px;
}

.listens {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.headphone-icon {
  font-size: 14px;
}

.listens-count {
  font-size: 12px;
  color: #666;
}

.item-title {
  font-size: 14px;
  font-weight: bold;
  margin: 0 0 5px 0;
  color: #333;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-desc {
  font-size: 12px;
  color: #999;
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 768px) {
  .music-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .category-tabs {
    gap: 10px;
  }
  
  .tab {
    padding: 6px 12px;
    font-size: 12px;
  }
}
</style>
